/*
 * @(#)NumberUtils.java $version 2010. 8. 11
 *
 * Copyright 2007-2010 NHN Corp. All rights Reserved. 
 * NHN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.nhncorp.usf.core.util;

/**
 * @author Web Platform Development Team.
 */
public class NumberUtils {

    /**
     * To int.
     *
     * @param str          the str
     * @param defaultValue the default value
     * @return the int
     */
    public static int toInt(String str, int defaultValue) {
        if (str == null) {
            return defaultValue;
        }
        try {
            return Integer.parseInt(str);
        } catch (NumberFormatException nfe) {
            return defaultValue;
        }
    }
}
